<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 输入框获取的内容永远都是字符串 -->
        <!-- 
            .number把输入内容转换成数值类型
         -->
        <input type="text" v-model.number="num1">   
        <input type="text" v-model.number="num2">   
        <span>{{ num1 + num2 }}</span>
         <h3>以下是trim</h3>
        <input type="text" v-model.trim="msg">
        <h3>以下是lazy</h3>
        <!-- 默认情况下是一边输入就一边对数据赋值 -->
        <!-- lazy要等输入完了才会对数据进行赋值 -->
        <!-- 按回车或者失去焦点都叫输入完了 -->
        <input type="text" v-model.lazy.trim="msg">
        <p>{{ msg }}</p>
    </div>
    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: "#app",
            data() {
                return {
                   num1: 0,
                   num2: 0,
                   msg: ''
                }
            },
            methods:{
                   
            }
        })
    </script>
</body>
</html>